{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pulse Nulling Example Notebook\n",
    "\n",
    "This notebook will serve as an exampe of how to use the pulse nulling feature of the `Pulse Signal Simulator`. It will not go into explicit detail about how the `PsrSigSim` works, and a full documentation can be found at:\n",
    "\n",
    "https://psrsigsim.readthedocs.io/en/latest/ \n",
    "\n",
    "Particularly under the example notebooks. This will serve only to show how the pulse nulling and pdv saving works.\n",
    "The `PsrSigSim` can be installed with `pypi` using: `pip install psrsigsim`. Current python version supported are 3.5-3.7."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 326,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The autoreload extension is already loaded. To reload it, use:\n",
      "  %reload_ext autoreload\n"
     ]
    }
   ],
   "source": [
    "# Start by importing the packages we will need for the simulation; start with simulator\n",
    "#import PsrSigSim.psrsigsim as pss # for local development\n",
    "import psrsigsim as pss # from pip install\n",
    "\n",
    "# Additional necessary packages\n",
    "import numpy as np\n",
    "import scipy as sp\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "# helpful magic lines\n",
    "%matplotlib inline\n",
    "\n",
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We define a plotting convenience function for later."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 327,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define a function for easier plotting later on/throughout the testing\n",
    "def plotsignal(signals, nbins=2048):\n",
    "    # signals can be a list of multiple signals to overplot\n",
    "    for ii in range(len(signals)):\n",
    "        # Define the x axis\n",
    "        phases = np.linspace(0.0, len(signals[ii]), len(signals[ii]))/nbins\n",
    "        # now plot it\n",
    "        plt.plot(phases, signals[ii], label=\"signal %s\" % (ii))\n",
    "    plt.xlim([0.0, np.max(phases)])\n",
    "    plt.xlabel(\"Pulse Phase\")\n",
    "    plt.ylabel(\"Arb. Flux\")\n",
    "    plt.show()\n",
    "    plt.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we will define some example simulation parameters. The warning generated below may be ignored."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 328,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Warning: specified sample rate 0.002048 MHz < Nyquist frequency 1600.0 MHz\n"
     ]
    }
   ],
   "source": [
    "# define the required filterbank signal parameters\n",
    "f0 = 1380 # center observing frequecy in MHz\n",
    "bw = 800.0 # observation MHz\n",
    "Nf = 2 # number of frequency channels\n",
    "F0 = np.double(1.0) # pulsar frequency in Hz\n",
    "f_samp = F0*2048*10**-6 # sample rate of data in MHz, here 2048 bins across the pulse\n",
    "subintlen = 1.0 # desired length of fold-mode subintegration in seconds\n",
    "# Now we define our signal\n",
    "null_signal = pss.signal.FilterBankSignal(fcent = f0, bandwidth = bw, Nsubband=Nf,\\\n",
    "                                          sample_rate=f_samp, fold=True, sublen=subintlen)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we define an example Gaussian pulse shape. Details on defining a pulse shape from a data array may be found in the exmample notebook in the docs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 329,
   "metadata": {},
   "outputs": [],
   "source": [
    "prof = pss.pulsar.GaussProfile(peak=0.5, width=0.05, amp=1.0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we define an example pulsar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 330,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the necessary parameters\n",
    "period = np.double(1.0)/F0 # seconds\n",
    "flux = 0.1 # Jy\n",
    "psr_name = \"J0000+0000\"\n",
    "# Define the pulsar object\n",
    "pulsar = pss.pulsar.Pulsar(period=period, Smean=flux, profiles=prof, name=psr_name)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we actually make the pulsar signal. Note that if the observation length is very long all the data will be saved in memory which may crash the computer or slow it down significantly."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 331,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the observation time, in seconds\n",
    "ObsTime = 3.0 # seconds\n",
    "# make the pulses\n",
    "pulsar.make_pulses(null_signal, tobs = ObsTime)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now lets take a look at what the signals look like."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 332,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEGCAYAAABhMDI9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAaKUlEQVR4nO3de5QedX3H8c8XQgiERJQsFxMwYDVoUwW6XBTrsYAVhYoUi9hiCceW03pUpLUUqxZrS+XYFitUuZS75QgaaKVcghAChBCSbALktrmRAElI2E022Ww2yV6//eOZ4M5en30u85t55v06J4fnMs/Md5h95vP8fjPzG3N3AQCw3wGhCwAApAvBAACIIRgAADEEAwAghmAAAMSMCV1AMSZNmuRTp04NXQYAZMrixYu3uXvdaD+XiWCYOnWqGhoaQpcBAJliZq+X8jm6kgAAMQQDACCGYAAAxBAMAICYqgWDmd1pZk1mtrzPa+8ysyfNbG3033dWa/kAgNJUs8Vwt6Rz+712jaTZ7v4+SbOj5wCAFKlaMLj7c5Ja+r18gaR7osf3SPpctZYPAChN0scYjnL3LZIU/ffIoSY0syvMrMHMGpqbmxMrEEA+tLR36vFlW0KXkUqpPfjs7re5e72719fVjfrCPQAY1l/c26C/um+Jtu3uCF1K6iQdDG+Z2TGSFP23KeHlA4AkadOOPZKk7h5uVtZf0sHwsKTLoseXSfpVwssHAIygmqer/lzSfEnTzGyTmX1Z0vWSPmlmayV9MnoOAE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77w2en2Gmf1nOfMGQiEYUEv2uvtJ7j5dUqekv0xouXPd/WRJ9ZIuNbNau2odOUMwoFbNlfRbZjbV+txHwcy+aWbf6z+xmV1vZiujQQz/LXqtzsweNLNF0b8zh1ugu7dLWizpvdFL7zazWWa21sx+2GdZN5tZQ//x8ytRA1AJqbnyGaiUaDyYT0uaVeT075J0oaQT3d33DzEg6ceSfuTuz5vZcSpcuf6BYeZzhAr3KvgnSadKOkmFkTw7JK02s5vcfaOkb7t7S3S16mwz+5AK49mUXQNQCQQDaskhfYY8mKvCUADvLuJzuyTtk3S7mT0q6ZHo9XMkfdB+M3T9RDObEI3p39fvmdlLknolXR8Nd3KqpNnu3ipJZrZS0ntUGP74YjO7QoXv3zGSPihpZZk1ABVDMKCW7I2GH35bNPZN3y7Tcf0/FI1ldZqks1UYR+arks6KPvcRd987wnLnuvv5g7ze0edxj6QxZna8pG9KOtXdd5jZ3ZLGVaAGoGI4xoBa95akI83sCDM7WNKAHbgVxul/RzTc8jdU6AKSpF+rsIPeP91J/T9bgomS2iW1mtlRKnR5JV0DMCxaDKhp7t4VjTS5QNIGDRySWCrcB/hXZjZOhZuaXBW9/nVJPzGzpSp8V55TmWc6ufsrUbfTCknrJc1LugZgJIyuCgCIoSsJABBDMAAAYggGAEAMwQAAiCEYAAAxBAMAIIZgAADE/D/QaI/kjUv85gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# We plot just the first frequency channel, but all pulses simulated\n",
    "plotsignal([null_signal.data[0,:]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can disperse the simuated data if desired. Note that this is not required, and if you only want to simulate a single frequency channel or simulate coherently dedispersed data, the data does not have to be dispersed."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 333,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r",
      "100% dispersed in 0.003 seconds."
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAeEklEQVR4nO3de5wU1Z028OeZG3dUriIQ8AIIYRV1VJR4Q40mYtxNTF6zn3jLGta8Jl42iTHrNdkYdbNv1OgbDTFKVJLoSozECyKgq6JBBgHlIoqKiNwGgWEG5tbTv/2je6Adama6e7rqVHU938+Hj93T1dW/smb6qXNO1SmaGURERNoqcV2AiIiEkwJCREQ8KSBERMSTAkJERDwpIERExFOZ6wJyMWDAABs5cqTrMkREImXx4sVbzWxgru+LVECMHDkSVVVVrssQEYkUkh/l8z51MYmIiCcFhIiIeFJAiIiIJwWEiIh4UkCIiIgnBYSIiHhSQIiIiCcFhIhIGxtr6jH/nc2uy3BOASEi0sa59yzAt6frolwFhIhIG1vrGl2XEAoKCBER8aSAEBERTwoIERHxpIAQERFPCggREfGkgBAREU8KCBER8aSAEBERTwoIERHxpIAQERFPCggRkXaYmesSnFJAiIiIJwWEiEg7Yt6AUECIiIg3BYSISDti3oBQQIiIiDcFhIhIO3QWk0Mk9yf5BMl3SK4ieYLLekREZK8yx59/N4DZZnY+yQoAPR3XIyKyR7zbDw4DgmRfACcDuAQAzKwJQJOrekRE2op5D5PTLqZDAFQDeIjkEpIPkOzVdiGSU0lWkayqrq4OvkoRkZhyGRBlAI4GcJ+ZHQVgF4Dr2i5kZtPMrNLMKgcOHBh0jSISYxbzTiaXAbEewHozW5h+/gRSgSEiIiHgLCDMbBOAj0mOSf/odAArXdUj4oe7576HhR986roMyVPcxyBcn8X0fQAz0mcwfQDgUsf1iBTUnXPfBQCsvf0cx5WI5M7pdRBmtjQ9vn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eMfTm9M8vIXlvV9Yt4oICQopVvZlNMLPxAJoAXB7Q575iZkcBqATwLZLFdiW8xIgCQuLgFQCHkRzJjHs5kPwhyVvaLkzydpIr0xMm/lf6ZwNJziS5KP1vUkcfaGa7ACwGcGj6RweRnE3yPZL/mfFZ95Gsajt/fyFqEOmq0F1JLVJI6flmvgRgdpbL9wPwTwAONzNrnboAwN0A7jSzV0l+Dqmr4cd2sJ7+SN0v4T8AHAtgAlKzhzYCWE3yHjP7GMD1ZrYtffXrPJJHIDVfTpdrEOkqBYQUqx4Z0ym8gtQUAwdl8b6dABoAPEDyGQBPp39+BoBx3Dt1fl+SfdL3Fch0EsklAJIAbk9PpXIsgHlmVgMAJFcCGIHUtMvfIDkVqb/FIQDGAVjZxRpECkIBIcWqPj3t8R7p+XUyu1W7t31Ter6s4wCcjtQ8Nd8DMDn9vhPMrL6Tz33FzKZ4/Lwx43ELgDKSBwP4IYBjzWw7yekAuhegBpGC0BiExMlmAINI9ifZDcA+X+RM3Stgv/RUz1cj1TUEAHOQ+qJuXW5C2/fmoS+AXQBqSA5Gqiss6BpE2qUWhMSGmTWnZ7ZcCOBD7DsVMpC6V/FTJLsjdXOVa9I/vxLA/yf5FlJ/Ny+ji2dGmdmydHfUCgAfAFgQdA0iHdFsriIi4kldTCIi4kkBISIinhQQIiLiSQEhIiKeFBAiIuJJASEiIp4UECIi4ul/AR+SbqDY+uNiAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# First define the dispersion measure\n",
    "dm = 10.0 # pc cm^-3\n",
    "# Now define the ISM class\n",
    "ism_ob = pss.ism.ISM()\n",
    "# Now we give the ISM class the signal and disperse the data\n",
    "ism_ob.disperse(null_signal, dm)\n",
    "# If we plot the same pulses as above, you can see that the phase of the pulse has\n",
    "# been shfited due to the dispersion\n",
    "plotsignal([null_signal.data[0,:]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This is where the pulses should be nulled if desired. This can be run easily by giving the pulsar object only the signal class and the null fraction as a value between 0 and 1. The simulator will null as close to the null fraction as desired, and will round to the closest integer number of pulses to null based on the input nulling fraction, e.g. if 5 pulses are simulated and the nulling fraction is 0.5, it will round to null 3 pulses. Additionally, currently only the ability to null the pulses randomly is implemented. \n",
    "\n",
    "Here we will put in a nulling fraction of 33%"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 334,
   "metadata": {},
   "outputs": [],
   "source": [
    "pulsar.null(null_signal, 0.34)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 335,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAaYklEQVR4nO3de5gV9X3H8c93d1nu3gBRgYjGCxJrUFdESb2AiSZBbXOr6ZN4aS1NahJjczO1xqSX1DR9Yow2SYkxRmOrqcZovaPEqiRFFkW5CUFFRbksAgsLyy67++0f5yycLLO7Z3fPzG/OmffrefbhXObMfIc553zO/OY3vzF3FwAAXVWFLgAAkE4EBAAgEgEBAIhEQAAAIhEQAIBINaEL6IvRo0f7xIkTQ5cBAGVl0aJFm9x9TF9fV1YBMXHiRNXX14cuAwDKipm93p/X0cQEAIhEQAAAIhEQAIBIBAQAIBIBAQCIREAAACIREACASAQEAHSxrrFZ817eELqM4AgIAOji/Jvm6y9u46RcAgIAutjU1BK6hFQgIAAAkQgIAEAkAgIAEImAAABEIiAAAJEICABAJAICABCJgAAARCIgAACRCAgAQCQCAgC64e6hSwiKgAAARCIgAKAbGd+BICAAANEICADoRsZ3IAgIAEA0AgIAukEvpoDM7AAzu8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kv5O0ruk8t9+Km79ynkbHirp52ZWrVyw/dLdHxzIdydDbQAAIqWxiQkAkAIEBAAgEgEBAIhEQAAAIhEQAIBIBAQqkpm150fjXGpm/21mw3qZ/jYz+9gAl9k5EugL+RFDr8s/fqmZ3TyQeQMhEBCoVM3uPsXdj5fUKukzCS33GXc/UVKdpE+ZWaWdCY8MISCQBc9IOsrMJlrBtRzM7Mtm9s2uE5vZ9Wa2PD9g4r/lHxtjZvea2cL83/SeFujuOyQtkvTu/EOHmdmjZvZ7M/vXgmX9yMzqu47fX4oagIFK3ZnUQCnlx5v5oKRHi5z+IEl/KmmSu3vn0AWSbpR0g7s/a2bvUu5s+ON6mM8o5a6X8I+STpE0RbnRQ1skrTSzm9z9TUnXuPvm/NmvT5rZCcqNlzPgGoCBIiBQqYYWDKfwjHJDDBxWxOu2Sdol6RYze0jSg/nHz5E02fYOnb+fmY3MX1eg0B+b2QuSOiRdnx9K5RRJT7p7oySZ2XJJhys37PInzGy2cp/FQyVNlrR8gDUAJUFAoFI154c93iM/vk5hs+qQri/Kj5c1VdJM5cap+ZykGfnXnebuzb0s9xl3nxXxeEvB7XZJNWZ2hKQvSzrF3beY2W2ShpSgBqAkOAaBLNkg6WAzG2VmgyXt80VuuWsF7J8f6vmLyjUNSdLjyn1Rd043petr+2E/STskNZrZWOWawpKuAegWexDIDHffnR/ZcoGk17TvUMhS7lrF95vZEOUurnJV/vEvSPp3M3tJuc/N0xpgzyh3fzHfHLVM0quS5iddA9ATRnMFAESiiQkAEImAAABEIiAAAJEICABAJAICABCJgAAARCIgAACR/h/HnL1vdCAU1QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# and plot the signal to show the null\n",
    "plotsignal([null_signal.data[0,:]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also add radiometer noise from some observing telescope. This should only be run AFTER the pulsar nulling, but is not required. For our example, we will use the L-band feed for the Arecibo telescope. Note that here since we have set the pulsar flux very high we can easily see the single pulses above the noise."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 336,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError. [astropy.units.quantity]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEJCAYAAACOr7BbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dd3wUdfoH8M8TCISONKUIAbEhKgpi4Syn3NnLqXc/f2c59e78ec12emK5U+znKWdHsZ9yNqrSpJeAAgmEEmoCCSQQUknv+/z+2N1ks5ndbLbNbObzfr14sWV29pnMzjzfNt8RVQUREZG3OLMDICIia2KCICIiQ0wQRERkiAmCiIgMMUEQEZEhJggiIjJkaoIQkQdFJE1EtovIFyKSYGY8RETUxLQEISKDAdwHYJyqjgbQAcAtZsVDRETNdbTA93cRkToAXQEc8rdwv379NDExMRpxERG1GykpKQWq2r+tnzMtQahqjoi8AuAAgCoAi1V1sfdyInIPgHsAYOjQoUhOTo5uoEREMU5EsoL5nJlNTMcAuB7AcACDAHQTkdu8l1PVaao6TlXH9e/f5gRIRERBMrOTeiKA/aqar6p1AGYBuMDEeIiIyIOZCeIAgPNEpKuICIDLAOw0MR4iIvJgWoJQ1fUAZgDYBGCbK5ZpZsVDRETNmTqKSVWfAvCUmTEQEZExXklNRESGmCCIiMgQEwQRkZfDJVVYvuuI2WGYjgmCiMjLtW+uxd2f8KJcJggiIi8F5TVmh2AJTBBERGSICYKIiAwxQRARkSEmCCIiMsQEQUREhpggiIjIEBM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h7TKayBc4qBQQF8rhRANYAPRGQ+gHmu1ycCGCVNU+f3FJEervsKeLpQRDYDcAB4yTWVyjkAlqlqCQCIyA4Aw+CcdvlXInIPnMfiQACjAOwIMQaisGCCoPaqyjXtcSPX/DqezaoJ3h9yzZc1HsBlcM5T82cAl7o+d76qVrXyvWtU9RqD12s8HjcA6CgiwwE8DOAcVS0WkU8AJIQhBqKwYB8E2ckRAANEpK+IdAbQ4kQuznsF9HJN9fwAnE1DALAYzhO1e7kx3p8NQk8AFQBKRORYOJvCoh0DkU+sQZBtqGqda2bL9QD2o+VUyIDzXsVzRSQBzpurPOh6/T4Ab4vIVjiPm9UIcWSUqm5xNUelAdgHYG20YyDyh7O5EhGRITYxERGRISYIIiIyxARBRESGmCCIiMgQEwQRERligiAiIkNMEEREZOj/AV8QcnFw7XLGAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# We define the telescope object\n",
    "tscope = pss.telescope.telescope.Arecibo()\n",
    "# Now add radiometer noise; ignore the output here, the noise is added directly to the signal\n",
    "output = tscope.observe(null_signal, pulsar, system=\"Lband_PUPPI\", noise=True)\n",
    "# and plot the signal to show the added noise\n",
    "plotsignal([null_signal.data[0,:]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can save the data in a `PSRCHIVE pdv` format. This is done with the `txtfile` class. The save function will dump a new file for every 100 pulses that it writes to the text file. We start by initializing the `txtfile` object. The only input needed here is the `path` variable, which will tell the simulator where to save the data. All files saved will have \"_\\#.txt\" added to the end of the `path` variable."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 337,
   "metadata": {},
   "outputs": [],
   "source": [
    "txtfile = pss.io.TxtFile(path=\"PsrSigSim_Simulated_Pulsar.ar\")\n",
    "# Now we call the saving function. Note that depending on the length of the simulated data this may take awhile\n",
    "# the two inputs are the signal and the pulsar objects used to simulate the data.\n",
    "txtfile.save_psrchive_pdv(null_signal, pulsar)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And that's all that there should be to it. Let us know if you have any questions moving forward, or if something is not working as it should be."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
